package com.itqf.Controller;

import com.itqf.Enum.CodeEnum;
import com.itqf.Service.Topic.TopicService;
import com.itqf.Util.DTO.ResultDTO;
import com.itqf.entity.Topic;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/huileme/a/m/TopicDetailController")
public class TopicDetailController {
    @Resource
    private TopicService topicService;


    @RequestMapping(value = "/topdetail",method = RequestMethod.GET)
    @ResponseBody
    /**
        * @Description:
        * @Param: [topicId]
        * @return: com.itqf.entity.Topic
        * @Author: 赵渊
        * @Date: 20:23
        *///通过商品id查找某个商品的详细信息
    public ResultDTO<Topic> getTopicbytopid(int topicId)
    {

       Topic topic=topicService.getTopicbytopid(topicId);
       ResultDTO resultDTO=new ResultDTO();
       if (topic!=null)
       {
         resultDTO.setData(topic);
         resultDTO.setCode(CodeEnum.selectsuccess.getCode());
         resultDTO.setMessage(CodeEnum.selectsuccess.getMsg());
       }
       return resultDTO;
    }

}
